package com.xinqing.test.LetCode;

import java.util.HashSet;

/**
 * @Author:CHQ
 * @Date:2021/7/21 10:11
 * @Description
 */
public class HammingWeight {
    public static void main(String args[]){

        System.out.println(test(100000100));

    }
    public static int test(Integer x){
        int count=0;
        String s=String.valueOf(x);
        for(char c:s.toCharArray()){
            if(c=='1'){
                count++;
            }
        }
        return count;
    }

}
